package com.diapoclic.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the Folder database table.
 * 
 */
@Entity
public class Folder implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="id_folder")
	private int idFolder;

    @Temporal( TemporalType.DATE)
	@Column(name="date_creation")
	private Date dateCreation;

    @Temporal( TemporalType.DATE)
	@Column(name="date_update")
	private Date dateUpdate;

	@Column(name="name_folder")
	private String nameFolder;

	@Column(name="nb_doc")
	private int nbDoc;

	//bi-directional many-to-one association to User
    @ManyToOne
	@JoinColumn(name="id_user")
	private User user;

	//bi-directional many-to-many association to Document
    @ManyToMany
	@JoinTable(
		name="contenir"
		, joinColumns={
			@JoinColumn(name="id_folder")
			}
		, inverseJoinColumns={
			@JoinColumn(name="id_doc")
			}
		)
	private Set<Document> documents;

    public Folder() {
    }

	public int getIdFolder() {
		return this.idFolder;
	}

	public void setIdFolder(int idFolder) {
		this.idFolder = idFolder;
	}

	public Date getDateCreation() {
		return this.dateCreation;
	}

	public void setDateCreation(Date dateCreation) {
		this.dateCreation = dateCreation;
	}

	public Date getDateUpdate() {
		return this.dateUpdate;
	}

	public void setDateUpdate(Date dateUpdate) {
		this.dateUpdate = dateUpdate;
	}

	public String getNameFolder() {
		return this.nameFolder;
	}

	public void setNameFolder(String nameFolder) {
		this.nameFolder = nameFolder;
	}

	public int getNbDoc() {
		return this.nbDoc;
	}

	public void setNbDoc(int nbDoc) {
		this.nbDoc = nbDoc;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	public Set<Document> getDocuments() {
		return this.documents;
	}

	public void setDocuments(Set<Document> documents) {
		this.documents = documents;
	}
	
}